import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
import { routerBase } from '@/setting'

Vue.use(VueRouter)

const router = new VueRouter({
  mode: 'history',
  base: routerBase,
  routes
})

router.beforeEach((to, from, next) => {
  // 未登录时
  // if (vueStore.state.hasLogout) {
  //   next(false)
  //   goToLogin()
  // } else {
  //   next()
  // }
  next()
})

export default router
